<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Returns embed code for conditional loading of Remote-Learner.net's local jquery plugin.
 *
 * @package    local_rljquery
 * @link       http://jquery.com/
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 of later
 * @copyright  (C) 2013 Remote Learner.net Inc http://www.remote-learner.net
 */

defined('MOODLE_INTERNAL') || die();

/**
 * Return the markup which plugins can write to the page to load jQuery.
 *
 * @return string HTML fragment.
 */
function local_rljquery_return_markup() {
    global $CFG;

    $scriptlink = $CFG->wwwroot."/local/rljquery/servejs.php";
    $markup = "<script>window.jQuery || document.write('<script src=\"".$scriptlink."\"><\/script>')</script>";
    return $markup;
}
